#include <iostream>
#include <cmath>

using namespace std;

typedef long long ll;


int main()
{
    ll x;
    cin >> x;
    ll a = sqrt(x);
    ll x1 = a * a, x2 = (a + 1) * (a + 1);

    cout << (x - x1 < x2 - x ? x1 : x2) << endl;

    return 0;
}